package cliente;

import java.io.*;
import sop_corba.*;
import org.omg.CosNaming.*;
import org.omg.CORBA.*;
import org.omg.PortableServer.*;
import org.omg.PortableServer.POA;

public class Cliente{

    public Cliente(){
		
    }

    public static void main(String args[]){
        try{

            CallbackImpl objcllbckimpl = new CallbackImpl();
            		
            ORB orb = ORB.init(args, ((java.util.Properties) (null)));
            POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
            poa.the_POAManager().activate();
            org.omg.CORBA.Object obj = orb.resolve_initial_references("NameService");
            NamingContextExt namingcontextext = NamingContextExtHelper.narrow(obj);
            String s = "jppt";
            Juego juegopptint = JuegoHelper.narrow(namingcontextext.resolve_str(s));
            
            org.omg.CORBA.Object obj1 = poa.servant_to_reference(objcllbckimpl);
            Callback objcllbckint = CallbackHelper.narrow(obj1);
                        
            Login reg = new Login();
            reg.setJuego(juegopptint);
            reg.setCallback(objcllbckint);
            reg.setCallbackImpl(objcllbckimpl);
            reg.setLocationRelativeTo(null);
            reg.setResizable(false);
            reg.setTitle("Registro");
            reg.setVisible(true);
            
        }
        catch(Exception e){
            System.out.print("Error... "+e.getMessage()+" \n");
        }
    }

}